# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=athena-ssl-scanner
pkgver=0.6.2
pkgrel=5
groups=('blackarch' 'blackarch-scanner' 'blackarch-crypto')
pkgdesc='A SSL cipher scanner that checks all cipher codes. It can identify about 150 different ciphers.'
arch=('any')
url='http://packetstormsecurity.com/files/93062/Athena-SSL-Cipher-Scanner.html'
license=('GPL3')
depends=('java-environment')
source=("https://dl.packetstormsecurity.net/UNIX/scanners/athena-ssl-cipher-check_v${pkgver//./}.tar.gz")
sha512sums=('1a99eb636d8921aea56eb1e47fd4aac9869144ba0b84fc51f83f8e57eb9f31840ca1847478026200d043b11acc1f09cb9f6940fa50b46d5ba419f3b9bb906d93')

package() {
  cd "athena-ssl-cipher-check_v${pkgver//./}"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm LICENSE

  mv athena-ssl-cipher-check_v${pkgver//./}.jar athena-ssl-cipher-check.jar

  cp -a * "$pkgdir/usr/share/$pkgname"

  find "$pkgdir" -type f -exec chmod 644 {} +

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/athena-ssl-cipher-check.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

